package com.demo0211;

/**
 * Created by cc
 * Description:
 * User: CZH
 * Date: 2023-02-11
 * Time: 18:21
 */
public class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;

    TreeNode() {}
    TreeNode(int val) { this.val = val; }
    TreeNode(int val, TreeNode left, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }

    public boolean checkTree(TreeNode root) {
        if (root == null) {
            return false;
        }
        int value = (root.left.val) + (root.right.val);
        if (value == root.val) {
            return true;
        }
        return false;
    }

}
